import java.util.Random;

public class TestToolBox {

	public int reps;
	public int last;
	public int first;
	public int steps;

	public TestToolBox(int first, int last, int reps, int steps) {
		this.reps = reps;
		this.steps = steps;
		this.last = last;
		this.first = first;
	}

	public int[] randomizeArray(int[] array) {
		Random rnd = new Random();
		int tmp;
		int index;
		for (int j = 0; j < array.length / 5; j++) {
			for (int i = 0; i < array.length; i++) {
				tmp = array[i];
				index = 0 + rnd.nextInt(Math.abs(array.length));
				array[i] = array[index];
				array[index] = tmp;
			}
		}
		return array;
	}

	public int[] makeStepArray() {
		int stepSize = (int) Math.ceil((last - first) / steps);
		int[] stepArray = new int[steps + 1];
		stepArray[0] = first;
		// make interval boundary array
		for (int i = 1; i <= steps; i++) {
			stepArray[i] = stepArray[i - 1] + stepSize;
		}
		return stepArray;
	}

	public int[] populateArray(int first, int last) {
		int length = Math.abs(last) - Math.abs(first);
		int[] arr = new int[length + 1];
		for (int i = 0; i <= length; i++) {
			arr[i] = first;
			first++;
		}
		return arr;
	}
}
